*** Create Figure 2 ***

********************************************************************************

clear 

** read in .dta file **
use "${clean}/who_counts_descriptives.dta", clear

** Show retrospective nature of original registration status variable **

preserve

drop if YOB < 1945
drop if YOB > 1994
keep if Registration==1
sum(count)
myers age, range(10 49)

graph bar, over(age, label(angle(45) labsize(tiny))) title("Age Heaping, 1944-1984, Registered") note("N=1.5M, Myers Blended Index: 3.86")
graph save "${output}/graphs/heaping_reg_orig.gph", replace
graph export "${output}/graphs/heaping_reg_orig.png", replace

restore

preserve

drop if YOB < 1945
drop if YOB > 1994
keep if Registration==0
sum(count)
myers age, range(10 49)

graph bar, over(age, label(angle(45) labsize(tiny))) title("Age Heaping, 1944-1984, Unregistered") note("N=75K, Myers Blended Index: 15.5")
graph save "${output}/graphs/heaping_unreg_orig.gph", replace
graph export "${output}/graphs/heaping_unreg_orig.png", replace

restore

grc1leg "${output}/graphs/heaping_reg_orig.gph" "${output}/graphs/heaping_unreg_orig.gph", title(Original Registration Status)rows(2) legendfrom("${output}/graphs/heaping_unreg_orig.gph")
graph save "${output}/graphs/Figure2.gph", replace
graph export "${output}/graphs/Figure2.png", replace

********************************************************************************
